#ifndef DOCKFACTORY_H
#define DOCKFACTORY_H

#include "qads_global.h"

QADS_BEGIN_NAMESPACE

class DockTab;
class DockTitleBar;
class DockTabBar;
class DockPannel;
class DockWidget;

class QADS_EXPORT DockFactory
{
public:
    /**
     * Force virtual destructor
     */
    virtual ~DockFactory() {}

    /**
     * This default implementation just creates a dock widget tab with
     * new DockTab(DockWIdget).
     */
    virtual DockTab *createDockTab(DockWidget *DockWidget) const;

    /**
     * This default implementation just creates a dock area tab bar with
     * new DockTabBar(DockArea).
     */
    virtual DockTabBar *createDockTabBar(DockPannel *DockArea) const;

    /**
     * This default implementation just creates a dock area title bar with
     * new DockTitleBar(DockArea).
     */
    virtual DockTitleBar *createDockTitleBar(DockPannel *DockArea) const;

    /**
     * Returns the default components factory
     */
    static const DockFactory *factory();

    /**
     * Sets a new default factory for creation of GUI elements.
     * This function takes ownership of the given Factory.
     */
    static void setFactory(DockFactory *Factory);

    /**
     * Resets the current factory to the
     */
    static void resetDefaultFactory();
};

inline const DockFactory *factory()
{
    return DockFactory::factory();
}

QADS_END_NAMESPACE

#endif // DOCKFACTORY_H
